package com.duan.goods.feign;


import com.duan.entity.Result;
import com.duan.goods.pojo.Detail;
import com.duan.goods.pojo.ProductDetails;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "goods")
public interface ProductFeign {
    /**
     * 查询商品详情页
     */
    @GetMapping("/detail/findDetail")
    Result<Detail> findDetail(@RequestParam Long id);

    /**
     * 条件查询
     * @param productDetails
     * @return
     */
    @PostMapping("/productDetails/selectList")
    Result<List<ProductDetails>> select(@RequestBody ProductDetails productDetails);

    /**
     * 减库存
     * @param productId
     * @return
     */
    @PostMapping("/productDetails/reducedInventory")
    public Result reducedInventory(@RequestParam Long productId,@RequestParam Integer num);
}

